<%@ page pageEncoding="utf-8" contentType="text/html; charset=utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd style="text-align:center"">
<html>
<head>
<title>活动模板管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
<script type="text/javascript">
    function view(tid) {
        $("#intro-"+tid).toggle();
    }

    function confirmBtn(obj, tid) {
        $(obj).hide();
        $("#href-del"+tid).show();
    }
    function mout(tid) {
        $("#btn"+tid).show();
        $("#href-del"+tid).hide();
    }

</script>
</head>
<body>
<div>
<jsp:include page="_head.jsp"></jsp:include>
	<table class="table table-bordered">
		<thead>
			 <tr style="">
			<td width="150"><strong>ID</strong></td>
			<td><strong>标题</strong></td>
			<td><strong>日期区间</strong></td>
			<td><strong>创建日期</strong></td>
			<td><strong><a href="/admin/act/tmpl/setting.do">新建活动</a></strong></td>
			</tr>
		</thead>
		<tbody id="body_id">
		<c:forEach var="entry" items="${list}">
			<tr>
				<td>
                    ${entry.tid}
                </td>
				<td>
                    ${entry.title}
				</td>
                <td>${entry.begin_date} ~ <br/>${entry.end_date}</td>
				<td>
					${entry.at_time}&nbsp;<br/>&nbsp;&nbsp;
					<c:if test="${entry.is_pause!=0}"><font color="FF0000">停止中</font></c:if>
				</td>
				<td width="255px">
					<a href="/admin/act/tmpl/toedit.do?tid=${entry.tid}" title="进入活动配置页面">
					<span style="color:green">配置&详细</span></a>&nbsp;&nbsp;
					<a href="javascript:void()" onclick="javascript:view(${entry.tid})">查看说明</a>&nbsp;&nbsp;&nbsp;
					<c:if test="${entry.is_pause!=0}">
                        <a href="/admin/act/tmpl/unpause.do?tid=${entry.tid}" title="启用后如果活动时间未过,活动将会进行">
                        <span style="color:red">启用</span></a>&nbsp;&nbsp;&nbsp;
					</c:if>
					<c:if test="${entry.is_pause==0}">
                        <a href="/admin/act/tmpl/pause.do?tid=${entry.tid}" title="停止后的活动将不再显示">
                        <span style="color:red">停止</span></a>&nbsp;&nbsp;&nbsp;
                    </c:if>

					<input id="btn${entry.tid}" type="button" value="删除" onclick="javascript:confirmBtn(this, ${entry.tid})"/>
					<a id="href-del${entry.tid}" style="display:none" onmouseout="javascript:mout(${entry.tid})" href="/admin/act/tmpl/del.do?tid=${entry.tid}" title="删除活动和产生的数据">
					<span style="color:red">执行删除</span></a>
				</td>
			</tr>
			<tr id="intro-${entry.tid}" style="display:none"><td colspan="6">活动简介: ${entry.intro}</td></tr>
		</c:forEach>
		</tbody>
	</table>
  </body>
</html>